import {AfterContentChecked, AfterContentInit, AfterViewInit, Component, OnDestroy, OnInit} from '@angular/core';

@Component({
  selector: 'app-content',
  templateUrl: './content.component.html',
  styleUrls: ['./content.component.css']
})
export class ContentComponent implements OnInit,AfterContentInit,AfterContentChecked,AfterViewInit,OnDestroy {

  title: string = 'tomg';

  divContent:"<div>嵌入div</div>";

  constructor() {
  }

  ngOnInit() {
  }

  /*在投影内容被组装完之后调用*/
  ngAfterContentInit(): void {
    console.log("父组件投影完成初始化完毕");
  }

  ngAfterContentChecked(): void {
    console.log("父组件投影变更检测完毕");
  }

  /*在组件视图组件完成后调用*/
  ngAfterViewInit(): void {
    console.log("父组件视图初始化完毕");
  }

  ngOnDestroy(): void {
    console.log("父组件被销毁");
  }

}
